import java.util.Arrays;

public class Brute {
	public static void main(String[] args) {
		// rescale coordinates and turn on animation mode
        StdDraw.setXscale(0, 32768);
        StdDraw.setYscale(0, 32768);
        StdDraw.show(0);
		
		String filename = args[0];
        In in = new In(filename);
        int N = in.readInt();        
        Point[] arr = new Point[N];
        for (int i = 0; i < N; i++) {
            int x = in.readInt();
            int y = in.readInt();
            arr[i] = new Point(x, y);
            arr[i].draw();
        }
        
        Arrays.sort(arr);

        for (int i=0; i<N; i++) {
        	for (int j=i+1; j<N; j++) {
        		for (int k=j+1; k<N; k++) {
        			if (arr[i].slopeTo(arr[j]) == arr[j].slopeTo(arr[k])) {
        				for (int s=k+1; s<N; s++) {
        					if (arr[j].slopeTo(arr[k]) == arr[k].slopeTo(arr[s])) {
        						StdOut.println(arr[i] + " -> " + arr[j] + " -> " + arr[k] + " -> " + arr[s]);
        						arr[i].drawTo(arr[s]);
        					}
        				}
        			}
        		}
        	}
        }
        StdDraw.show(0);      
	}
}
